|
|
|
|
|
|
|
Figure B.15
The Safety Settings dialog box determines the safety
level at which an object is registered on users' PCs. |
|
|
|
|
|
|
|
|
Safe for Scripting means that the object can be accessed from a scripting language, such as VBScript, without harming the user's computer. Safe for initialization means that someone can create an instance of your object without harming the user's computer. As an example, suppose you created an ActiveX control with a method that deletes files. Your Web pages might use this method responsibly, but someone else could use your control with their own VBScript code to perform malicious activities. Of course, in order for you to use your own control, these options need to be enabled, so make sure and put a lot of thoughts into the methods and properties you make available. |
|
|
|
|
|
|
|
|
See ''Installing Your Control over the Internet" p. 316 |
|
|
|
|
|
|
|
|
See "Using VBScript," p. 665 |
|
|
|
|
|
|
|
|
Files Created for the Internet |
|
|
|
|
|
|
|
|
The Package and Deployment Wizard creates a different kind of CAB file for Internet packages. As you may recall, a Standard installation package includes a SETUP.EXE file for the users to run. An Internet package, however, does not include a setup program because Internet Explorer handles the installation. Inside the CAB file is an INF file that tells Internet Explorer which files to install. A sample INF file is shown in Figure B.16. |
|
|
|
|
|
|
|
|
If you are creating an ActiveX control, IE also creates a sample HTM file. This file includes HTML code that you use to place the ActiveX control on one of your own Web pages: |
|
|
|
|
|
|
|
|
<OBJECT ID="UserControl1"
CLASSID="CLSID:9A15C6AE-CB22-11D1-BE62-10005A75B6DB"
CODEBASE="Project1.CAB#version=1,0,0,0">
</OBJECT> |
|
|
|
|
|
|
|
|
These few lines of HTML code are all you need to embed your ActiveX object in a Web page. Note that the object's unique class ID and version number are provided. Internet Explorer uses this information and the information in the INF file to determine whether it needs to download and install the ActiveX component. This is one of the strengths of ActiveX and Internet Explorer: You can place updated controls on your Web server and have them installed automatically on client PCs. |
|
|
|
|
|